//
//  UIImageView+JKExtension.m
//  01-百思不得姐
//
//  Created by albert on 16/3/28.
//  Copyright (c) 2016年 albert. All rights reserved.
//

#import "UIImageView+JKExtension.h"
#import "UIImageView+WebCache.h"

@implementation UIImageView (JKExtension)
/** 设置头像 */
- (void)setHeaderIcon:(NSString *)urlStr{
    //圆形占位图片
    UIImage *placeholder = [[UIImage imageNamed:@"Setting_Avatar"] circleImage];
    //设置图片
    [self sd_setImageWithURL:[NSURL URLWithString:urlStr] placeholderImage:placeholder completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
        //如果图片为空，就显示圆形的占位图片
        self.image = image ? [image circleImage] : placeholder;
    }];
}
@end
